from nltk import FreqDist, word_tokenize
import jieba
import matplotlib.pyplot as plt
from wordcloud import WordCloud


with open('../notebook/ch-1.txt', encoding='utf-8') as f:
    words = jieba.cut(f.read())
    words = [word for word in words if len(word) > 1]
    text = ' '.join(words)

text = word_tokenize(text)
print(text[:200])
freq_dict = FreqDist(text)
print(list(freq_dict)[:200])